<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>元素浮动后的特点</title>
    <style>
        .outer{
            width: 800px;
            height: 400px;
            padding:10px;
            background-color: gray;
        }
        .box {
            font-size: 20px;
            padding: 10px;
        }
        .box1 {
            background-color: skyblue;
        }
        .box2 {
            background-color: orange;
            float: left; /* 浮动后，宽高靠内容撑开 */
/*             width: 200px;
            height: 100px; */
        }
        .box3{
            background-color: green;
        }
    </style>
</head>
<body>
    <!-- 元素浮动之后是脱离文档流的 -->
    <div class="outer">
        <div class="box box1">盒子1</div>
        <div class="box box2">盒子2</div>
        <div class="box box3">盒子3</div>
    </div>
</body>
</html>